import request from '@/utils/request'
/**
 * @description 获取公司部门信息
 * @returns Promise
 */
export function getCompanyDepartmentAPI() {
    return request({
        url:'/company/department',
        method:'GET'
    })
}

/**
 * @description 获取员工简单列表(username id )
 * @returns Promise
 */
export function getEmployeesSimpleListAPI() {
    return request({
        url:'/sys/user/simple',
        method:'GET'
    })
}

/**
 * @description 新增部门
 * @param {Object} data pid:父级id  name:部门名称 code: 部门编码 manager:部门管理 troduce: 部门简介
 * @returns 
 */
export function createDepartmentAPI(data) {
    return request({
        url:'/company/department',
        method:'POST',
        data
    })
}
/**
 * @description 删除部门
 * @param {String} id 
 * @returns 
 */
export function deleteDepartmentAPI(id) {
    return request({
        url:`/company/department/${id}`,
        method:'DELETE',

    })
}

/**
 * @description 更新部门
 * @param {String} data
 * @returns 
 */
export function updateDepartmentAPI(data) {
    return request({
        url:`/company/department/${data.id}`,
        method:'PUT',
        data

    })
}

/**
 * @description 部门详情
 * @param {String} id 
 * @returns 
 */
export function getDepartmentDetailsAPI(id) {
    return request({
        url:`/company/department/${id}`,
        method:'GET',

    })
}